import Cookies from 'js-cookie'

// 准备一下时间戳的操作
const timeKey = 'timeA' // 设置一个独一无二的key
// 获取时间戳
export const getTimeStamp = () => {
  return Cookies.get(timeKey)
}

// 设置时间戳
export const setTimeStamp = () => {
  Cookies.set(timeKey, Date.now()) // 时间戳就是当前时间 所以设置的时间戳的值是now
}

const TokenKey = 'vue_admin_template_token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
